export function errorHandle(error, name) {
  let errorObj = joinArray
  let singleError;

  if (error || error != null) {

    if (error[name]) {
      singleError = error[name];
      return joinArray(singleError);
    }

    return;
  } else {
    return;
  }
};

export function joinArray(arr) {
  if (arr instanceof Array) {
    return arr.join(' ');
  }else{
    return arr;
  }
}